package com.xique.api.service.biz.service.impl;

import com.xique.api.bean.request.user.UserListRequest;
import com.xique.api.service.biz.service.IUserBizService;
import com.xique.common.core.utils.OrikaUtil;
import com.xique.common.core.utils.SecurityUtils;
import com.xique.common.core.web.domain.AjaxResult;
import com.xique.door.api.RemoteUserService;
import com.xique.door.api.request.user.RemoteUserListRequest;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

/**
 * @author shd
 * @create 2022/3/10 15:14
 */
@Service
public class UserBizServiceImpl implements IUserBizService {

    @Autowired
    private RemoteUserService userService;

    @Override
    public AjaxResult getUserList(UserListRequest request) {

        Long projectId = SecurityUtils.getForeignId();
        RemoteUserListRequest listRequest = OrikaUtil.convert(request, RemoteUserListRequest.class);
        listRequest.setProjectId(projectId);

        return userService.getUserList(listRequest);
    }
}
